From: kfraser@localhost.localdomain Date: Wed, 3 Jan 2007 10:01:32 +0000 (+0000) Subject: [HVM] Add triple-fault handler (resets the domain). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15422^2~105 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=5c9548534eba8c441fdc577268e38387efa047ed;p=xen.git [HVM] Add triple-fault handler (resets the domain). Todo: How to hook this for SVM? Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index ec045ad389..119b3bd625 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -269,6 +269,12 @@ void hvm_hlt(unsigned long rflags) do_sched_op_compat(SCHEDOP_block, 0); } +void hvm_triple_fault(void) +{ + gdprintk(XENLOG_INFO, "Triple fault - reset.\n"); + domain_shutdown(current->domain, SHUTDOWN_reboot); +} + /* * __hvm_copy(): * @buf = hypervisor buffer diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 36abbd290b..473b2eee06 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2404,7 +2404,8 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs) vmx_do_extint(regs); break; case EXIT_REASON_TRIPLE_FAULT: - goto exit_and_crash; + hvm_triple_fault(); + break; case EXIT_REASON_PENDING_INTERRUPT: /* Disable the interrupt window. */ v->arch.hvm_vcpu.u.vmx.exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING; diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h index 3f3ff94386..721492412a 100644 --- a/xen/include/asm-x86/hvm/support.h +++ b/xen/include/asm-x86/hvm/support.h @@ -134,5 +134,6 @@ void hlt_timer_fn(void *data); void hvm_do_hypercall(struct cpu_user_regs *pregs); void hvm_hlt(unsigned long rflags); +void hvm_triple_fault(void); #endif /* __ASM_X86_HVM_SUPPORT_H__ */